/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogBackground.java
 *
 * Created on 23/05/2011, 20:06:07
 */
package systole.view.tabs.results.background;

import java.awt.BorderLayout;

/**
 *
 * @author jmj
 */
public class JDialogBackground extends javax.swing.JDialog {

    private ControllerBackground controller;
    private JPnlBackgroundTable medicinesJPnlBackgroundTable;
    private JPnlBackgroundTable surgeriesJPnlBackgroundTable;
    private JPnlBackgroundTable pathologiesJPnlBackgroundTable;
    private JPnlBackgroundTable familyJPnlBackgroundTable;

    /** Creates new form JDialogBackground
     * @param parent
     * @param controller 
     */
    public JDialogBackground(java.awt.Frame parent, ControllerBackground controller) {
        super(parent, true);
        initComponents();
        this.controller = controller;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlCenter = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPnlTabMedicines = new javax.swing.JPanel();
        jPnlTabSurgeries = new javax.swing.JPanel();
        jPnlTabPathologies = new javax.swing.JPanel();
        jPnlTabFamily = new javax.swing.JPanel();
        jPnlButtons = new javax.swing.JPanel();
        jBtnOk = new javax.swing.JButton();
        jBtnCancel = new javax.swing.JButton();
        jPnlTop = new javax.swing.JPanel();
        jXHeader1 = new org.jdesktop.swingx.JXHeader();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogBackground.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N
        setResizable(false);

        jPnlCenter.setName("jPnlCenter"); // NOI18N
        jPnlCenter.setPreferredSize(new java.awt.Dimension(500, 350));
        jPnlCenter.setLayout(new java.awt.BorderLayout());

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
        jTabbedPane1.setPreferredSize(new java.awt.Dimension(400, 400));

        jPnlTabMedicines.setName("jPnlTabMedicines"); // NOI18N
        jPnlTabMedicines.setLayout(new java.awt.BorderLayout());
        jTabbedPane1.addTab(resourceMap.getString("jPnlTabMedicines.TabConstraints.tabTitle"), null, jPnlTabMedicines, resourceMap.getString("jPnlTabMedicines.TabConstraints.tabToolTip")); // NOI18N

        jPnlTabSurgeries.setName("jPnlTabSurgeries"); // NOI18N
        jPnlTabSurgeries.setLayout(new java.awt.BorderLayout());
        jTabbedPane1.addTab(resourceMap.getString("jPnlTabSurgeries.TabConstraints.tabTitle"), null, jPnlTabSurgeries, resourceMap.getString("jPnlTabSurgeries.TabConstraints.tabToolTip")); // NOI18N

        jPnlTabPathologies.setName("jPnlTabPathologies"); // NOI18N
        jPnlTabPathologies.setLayout(new java.awt.BorderLayout());
        jTabbedPane1.addTab(resourceMap.getString("jPnlTabPathologies.TabConstraints.tabTitle"), null, jPnlTabPathologies, resourceMap.getString("jPnlTabPathologies.TabConstraints.tabToolTip")); // NOI18N

        jPnlTabFamily.setName("jPnlTabFamily"); // NOI18N
        jPnlTabFamily.setLayout(new java.awt.BorderLayout());
        jTabbedPane1.addTab(resourceMap.getString("jPnlTabFamily.TabConstraints.tabTitle"), null, jPnlTabFamily, resourceMap.getString("jPnlTabFamily.TabConstraints.tabToolTip")); // NOI18N

        jPnlCenter.add(jTabbedPane1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPnlCenter, java.awt.BorderLayout.WEST);

        jPnlButtons.setName("jPnlButtons"); // NOI18N
        jPnlButtons.setPreferredSize(new java.awt.Dimension(400, 40));

        jBtnOk.setText(resourceMap.getString("jBtnOk.text")); // NOI18N
        jBtnOk.setName("jBtnOk"); // NOI18N
        jBtnOk.setPreferredSize(new java.awt.Dimension(75, 25));
        jBtnOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnOkActionPerformed(evt);
            }
        });
        jPnlButtons.add(jBtnOk);

        jBtnCancel.setText(resourceMap.getString("jBtnCancel.text")); // NOI18N
        jBtnCancel.setName("jBtnCancel"); // NOI18N
        jBtnCancel.setPreferredSize(new java.awt.Dimension(75, 25));
        jBtnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCancelActionPerformed(evt);
            }
        });
        jPnlButtons.add(jBtnCancel);

        getContentPane().add(jPnlButtons, java.awt.BorderLayout.PAGE_END);

        jPnlTop.setName("jPnlTop"); // NOI18N
        jPnlTop.setPreferredSize(new java.awt.Dimension(400, 50));
        jPnlTop.setLayout(new java.awt.BorderLayout());

        jXHeader1.setTitle(resourceMap.getString("jXHeader1.title")); // NOI18N
        jXHeader1.setName("jXHeader1"); // NOI18N
        jPnlTop.add(jXHeader1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPnlTop, java.awt.BorderLayout.NORTH);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBtnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnOkActionPerformed
        this.controller.ok();
    }//GEN-LAST:event_jBtnOkActionPerformed

    private void jBtnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancelActionPerformed
        this.controller.cancel();
    }//GEN-LAST:event_jBtnCancelActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnCancel;
    private javax.swing.JButton jBtnOk;
    private javax.swing.JPanel jPnlButtons;
    private javax.swing.JPanel jPnlCenter;
    private javax.swing.JPanel jPnlTabFamily;
    private javax.swing.JPanel jPnlTabMedicines;
    private javax.swing.JPanel jPnlTabPathologies;
    private javax.swing.JPanel jPnlTabSurgeries;
    private javax.swing.JPanel jPnlTop;
    private javax.swing.JTabbedPane jTabbedPane1;
    private org.jdesktop.swingx.JXHeader jXHeader1;
    // End of variables declaration//GEN-END:variables

    /**
     * 
     * @param backgroundTable
     */
    public void loadPathologiesPanel(JPnlBackgroundTable backgroundTable) {
        this.jPnlTabPathologies.add(backgroundTable, BorderLayout.CENTER);
        this.pathologiesJPnlBackgroundTable = backgroundTable;
    }

    /**
     *
     * @param backgroundTable
     */
    public void loadFamilyPanel(JPnlBackgroundTable backgroundTable) {
        this.jPnlTabFamily.add(backgroundTable, BorderLayout.CENTER);
        this.familyJPnlBackgroundTable = backgroundTable;
    }

    /**
     *
     * @param backgroundTable
     */
    public void loadMedicinesPanel(JPnlBackgroundTable backgroundTable) {
        this.jPnlTabMedicines.add(backgroundTable, BorderLayout.CENTER);
        this.medicinesJPnlBackgroundTable = backgroundTable;
    }

    /**
     *
     * @param backgroundTable
     */
    public void loadSurgeriesPanel(JPnlBackgroundTable backgroundTable) {
        this.jPnlTabSurgeries.add(backgroundTable, BorderLayout.CENTER);
        this.surgeriesJPnlBackgroundTable = backgroundTable;
    }

    /**
     * @return the medicinesJPnlBackgroundTable
     */
    public JPnlBackgroundTable getMedicinesJPnlBackgroundTable() {
        return medicinesJPnlBackgroundTable;
    }

    /**
     * @return the surgeriesJPnlBackgroundTable
     */
    public JPnlBackgroundTable getSurgeriesJPnlBackgroundTable() {
        return surgeriesJPnlBackgroundTable;
    }

    /**
     * @return the pathologiesJPnlBackgroundTable
     */
    public JPnlBackgroundTable getPathologiesJPnlBackgroundTable() {
        return pathologiesJPnlBackgroundTable;
    }

    /**
     * @return the familyJPnlBackgroundTable
     */
    public JPnlBackgroundTable getFamilyJPnlBackgroundTable() {
        return familyJPnlBackgroundTable;
    }
}
